﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Meqs.Logic.Implement;
using Meqs.Entity;

public partial class Login_S : System.Web.UI.Page
{
    protected static int UserID
    {
        get
        {
            string target = HttpContext.Current.Request.QueryString["userid"];
            int temp = 0;
            if (int.TryParse(target, out temp))
            {
                return temp;
            }
            return 0;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            StudentInfoLogic tiLogic = new StudentInfoLogic();
            StudentInfo ti = tiLogic.FindById(UserID);

            int count = tiLogic.CheckLogin("School", ti.StudentCode, ti.Passwd);
            Response.Redirect("main.aspx");

            
        }
    }
}
